import axios from './axios'

/* 获取所有文件夹 */
export function folderList(params){
    const url = '/ms/api/appDocumentManage/folder'
    return axios.get(url,params)
}

/* 获取所有文件列表 */
export function fileList(params){
    const url = '/ms/api/appDocumentManage/file'
    return axios.get(url,params)
}

/* 搜索文件 */
export function searchFile(params){
    const url = '/ms/api/appDocumentManage/file/search'
    return axios.get(url,params)
}

/* 新增文件、文件夹 */
export function addDocument(params){
    const url = '/ms/api/appDocumentManage/add/document'
    return axios.post(url,params)
}

/* oss直传配置 */
export function ossConfig(params){
    const url = '/ms/api/appDocumentManage/file/anon/getConfig'
    return axios.get(url,params)
}

/* 文件下载链接 */
export function downloadUrl(params){
    const url = '/ms/api/appDocumentManage/file/url'
    return axios.get(url,params)
}

/* 删除 */
export function delDocument(params){
    const url = '/ms/api/appDocumentManage/delete'
    return axios.post(url,params)
}

/* 移动文件 */
export function moveDocument(params){
    const url = '/ms/api/appDocumentManage/edit'
    return axios.post(url,params)
}

/* 重命名 */
export function editDocName(params){
    const url = '/ms/api/appDocumentManage/file/rename'
    return axios.postform(url,params)
}
